package com.ag.zrt.action;

import javax.annotation.Resource;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import java.util.List;
import com.ag.bean.TbEventPlanStart;

import com.ag.common.AgException;
import com.ag.common.BaseAction;
import com.ag.common.EventUtil;
import com.ag.zrt.service.IShowEventDetailService;

@Controller("showEventDetailAction")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class ShowEventDetailAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -9215047761603675058L;
	@Resource(name = "ShowEventDetailService")
	private IShowEventDetailService showEventDetailService;

	private String eventId = null;
	private String eventName;// 事件名
	private String planName;// 预案名
	private String happenedTime;// 事件发生的时间
	private String eventType;// 事件类型
	private String eventLevel;// 事件等级
	private String eventStatus;// 事件等级
	private String place;// 事发地点
	private String cause;// 事发原因
	private String eventDesc;// 事件描述
	private String measure;// 已采取措施
	private String submiter;// 报送人
	private String submitDept;// 报送部门
	private String source;// 事件来源
	private int death;// 死亡人数
	private int injured;// 受伤人数
	private String submitTime;// 报送时间
	private String submiterContact;// 报送人联系方式
	private String accpetTime;// 接报时间
	private String accepter;// 接报人

	private String teamLeader; // 查控组组长
	private String teamLeaderUid; // 查控组组长
	private String commander; // 总指挥
	private String commanderUid; // 总指挥
	private String implementPlan; // 应急部门
	private String assistDept; // 协助部门
	private String assistDeptDid; // 协助部门
	private String viceCommander;// 指挥长
	private String viceCommanderUid;// 指挥长
	private String content;// 呈批内容
	private String time;// 呈批时间
	private String leaderSuggestion;// 带班领导意见
	private String counts;// 呈批次数 

	private List<TbEventPlanStart> planStanderList; //预案启动标准
	
	
	public String showFive(){
		
		try {

			if (getSession().getAttribute(EventUtil.PROCESSING_EVENT_ID) != null) {
				eventId = (String) getSession().getAttribute(
						EventUtil.PROCESSING_EVENT_ID);
				
				if (showEventDetailService.findTeamLeader(eventId) != null) {
					teamLeader = showEventDetailService.findTeamLeader(eventId);
					teamLeaderUid = showEventDetailService.findTeamLeaderUId(eventId);
				}
				System.out
				.println(teamLeader
						+ "----------------------------teamLeader----------------------------------");
				System.out
				.println(teamLeaderUid
						+ "----------------------------teamLeaderUid----------------------------------");
				
				if (showEventDetailService.findCommander(eventId) != null) {
					commander = showEventDetailService.findCommander(eventId);
					commanderUid = showEventDetailService.findCommanderUId(eventId);
				}
				System.out
						.println(commander
								+ "----------------------------commander----------------------------------");
				System.out
				.println(commanderUid
						+ "----------------------------commanderUid----------------------------------");
				if (showEventDetailService.findImplementPlan(eventId) != null) {
					implementPlan = showEventDetailService
							.findImplementPlan(eventId);
				}
				System.out
						.println(implementPlan
								+ "----------------------------implementPlan----------------------------------");
				if (showEventDetailService.findAssistDept(eventId) != null) {
					assistDept = showEventDetailService.findAssistDept(eventId);
					assistDeptDid = showEventDetailService.findAssistDeptDId(eventId);
				}
				System.out
						.println(assistDept
								+ "----------------------------assistDept----------------------------------");
				System.out
				.println(assistDeptDid
						+ "----------------------------assistDeptDid----------------------------------");
				if (showEventDetailService.findViceCommander(eventId) != null) {
					viceCommander = showEventDetailService
							.findViceCommander(eventId);
					viceCommanderUid = showEventDetailService.findViceCommanderUId(eventId);
				}
				System.out
						.println(viceCommander
								+ "----------------------------viceCommander----------------------------------");
				System.out
				.println(viceCommanderUid
						+ "----------------------------viceCommanderUid----------------------------------");
				if (showEventDetailService.findCurRole(eventId) != null) {
					counts = showEventDetailService.findCurRole(eventId);
				}
				System.out
				.println(counts
						+ "----------------------------counts----------------------------------");
				
			}
		}catch(Exception e){
			e.printStackTrace();
		}
		
		return "showFive_succ";
		
	}

	public String getTeamLeaderUid() {
		return teamLeaderUid;
	}

	public void setTeamLeaderUid(String teamLeaderUid) {
		this.teamLeaderUid = teamLeaderUid;
	}

	public String getCommanderUid() {
		return commanderUid;
	}

	public void setCommanderUid(String commanderUid) {
		this.commanderUid = commanderUid;
	}

	public String getAssistDeptDid() {
		return assistDeptDid;
	}

	public void setAssistDeptDid(String assistDeptDid) {
		this.assistDeptDid = assistDeptDid;
	}

	public String getViceCommanderUid() {
		return viceCommanderUid;
	}

	public void setViceCommanderUid(String viceCommanderUid) {
		this.viceCommanderUid = viceCommanderUid;
	}

	public String getCounts() {
		return counts;
	}

	public void setCounts(String counts) {
		this.counts = counts;
	}

	public String getEventDesc() {
		return eventDesc;
	}

	public List<TbEventPlanStart> getPlanStanderList() {
		return planStanderList;
	}

	public void setPlanStanderList(List<TbEventPlanStart> planStanderList) {
		this.planStanderList = planStanderList;
	}

	public void setEventDesc(String eventDesc) {
		this.eventDesc = eventDesc;
	}

	public String getEventStatus() {
		return eventStatus;
	}

	public void setEventStatus(String eventStatus) {
		this.eventStatus = eventStatus;
	}

	public String getPlace() {
		return place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	public String getCause() {
		return cause;
	}

	public void setCause(String cause) {
		this.cause = cause;
	}

	public String getMeasure() {
		return measure;
	}

	public void setMeasure(String measure) {
		this.measure = measure;
	}

	public String getSubmiter() {
		return submiter;
	}

	public void setSubmiter(String submiter) {
		this.submiter = submiter;
	}

	public String getSubmitDept() {
		return submitDept;
	}

	public void setSubmitDept(String submitDept) {
		this.submitDept = submitDept;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public int getDeath() {
		return death;
	}

	public void setDeath(int death) {
		this.death = death;
	}

	public int getInjured() {
		return injured;
	}

	public void setInjured(int injured) {
		this.injured = injured;
	}

	public String getSubmitTime() {
		return submitTime;
	}

	public void setSubmitTime(String submitTime) {
		this.submitTime = submitTime;
	}

	public String getSubmiterContact() {
		return submiterContact;
	}

	public void setSubmiterContact(String submiterContact) {
		this.submiterContact = submiterContact;
	}

	public String getAccpetTime() {
		return accpetTime;
	}

	public void setAccpetTime(String accpetTime) {
		this.accpetTime = accpetTime;
	}

	public String getAccepter() {
		return accepter;
	}

	public void setAccepter(String accepter) {
		this.accepter = accepter;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String getLeaderSuggestion() {
		return leaderSuggestion;
	}

	public void setLeaderSuggestion(String leaderSuggestion) {
		this.leaderSuggestion = leaderSuggestion;
	}

	private String emergency;// 是否上报市应急
	private String government;// 是否上报政府
	private String asianGames;// 是否上报亚组委
	private String bureau;// 是否上报省局
	private String release;// 是否对外公开

	public String getEmergency() {
		return emergency;
	}

	public void setEmergency(String emergency) {
		this.emergency = emergency;
	}

	public String getGovernment() {
		return government;
	}

	public void setGovernment(String government) {
		this.government = government;
	}

	public String getAsianGames() {
		return asianGames;
	}

	public void setAsianGames(String asianGames) {
		this.asianGames = asianGames;
	}

	public String getBureau() {
		return bureau;
	}

	public void setBureau(String bureau) {
		this.bureau = bureau;
	}

	public String getRelease() {
		return release;
	}

	public void setRelease(String release) {
		this.release = release;
	}

	public String getEventType() {
		return eventType;
	}

	public void setEventType(String eventType) {
		this.eventType = eventType;
	}

	public String getEventLevel() {
		return eventLevel;
	}

	public void setEventLevel(String eventLevel) {
		this.eventLevel = eventLevel;
	}

	public String getHappenedTime() {
		return happenedTime;
	}

	public void setHappenedTime(String happenedTime) {
		this.happenedTime = happenedTime;
	}

	public String getEventId() {
		return eventId;
	}

	public void setEventId(String eventId) {
		this.eventId = eventId;
	}

	public String getEventName() {
		return eventName;
	}

	public void setEventName(String eventName) {
		this.eventName = eventName;
	}

	public String getPlanName() {
		return planName;
	}

	public void setPlanName(String planName) {
		this.planName = planName;
	}

	public void setShowEventDetailService(
			IShowEventDetailService showEventDetailService) {
		this.showEventDetailService = showEventDetailService;
	}

	public String findEventAndProposeDetail() {
		try {

			if (getSession().getAttribute(EventUtil.PROCESSING_EVENT_ID) != null) {
				eventId = (String) getSession().getAttribute(
						EventUtil.PROCESSING_EVENT_ID);
			}

			eventName = showEventDetailService.findEventName(eventId);
			System.out
					.println(eventName
							+ "----------------------------eventName----------------------------------");

			planName = showEventDetailService.findPlanName(eventId);
			System.out
					.println(planName
							+ "----------------------------planName----------------------------------");

			happenedTime = showEventDetailService.findHappenedTime(eventId);
			System.out
					.println(happenedTime
							+ "----------------------------happenedTime----------------------------------");

			eventLevel = showEventDetailService.findEventLevel(eventId);
			System.out
					.println(eventLevel
							+ "----------------------------eventLevel----------------------------------");

			eventType = showEventDetailService.findEventType(eventId);
			System.out
					.println(eventType
							+ "----------------------------eventType----------------------------------");
			if (showEventDetailService.findTeamLeader(eventId) != null) {
				teamLeader = showEventDetailService.findTeamLeader(eventId);
			}
			System.out
					.println(teamLeader
							+ "----------------------------teamLeader----------------------------------");
			if (showEventDetailService.findCommander(eventId) != null) {
				commander = showEventDetailService.findCommander(eventId);
			}
			System.out
					.println(commander
							+ "----------------------------commander----------------------------------");
			if (showEventDetailService.findImplementPlan(eventId) != null) {
				implementPlan = showEventDetailService
						.findImplementPlan(eventId);
			}
			System.out
					.println(implementPlan
							+ "----------------------------implementPlan----------------------------------");
			if (showEventDetailService.findAssistDept(eventId) != null) {
				assistDept = showEventDetailService.findAssistDept(eventId);
			}
			System.out
					.println(assistDept
							+ "----------------------------assistDept----------------------------------");
			if (showEventDetailService.findViceCommander(eventId) != null) {
				viceCommander = showEventDetailService
						.findViceCommander(eventId);
			}
			System.out
					.println(viceCommander
							+ "----------------------------viceCommander----------------------------------");

			emergency = showEventDetailService.emergency(eventId);
			System.out
					.println(emergency
							+ "----------------------------emergency----------------------------------");

			government = showEventDetailService.government(eventId);
			System.out
					.println(government
							+ "----------------------------government----------------------------------");

			asianGames = showEventDetailService.asianGames(eventId);
			System.out
					.println(asianGames
							+ "----------------------------asianGames----------------------------------");

			bureau = showEventDetailService.bureau(eventId);
			System.out
					.println(bureau
							+ "----------------------------bureau----------------------------------");

			release = showEventDetailService.release(eventId);
			System.out
					.println(release
							+ "----------------------------release----------------------------------");

			place = showEventDetailService.findPlace(eventId);
			System.out
					.println(place
							+ "----------------------------place----------------------------------");

			cause = showEventDetailService.findCause(eventId);
			System.out
					.println(cause
							+ "----------------------------cause----------------------------------");

			measure = showEventDetailService.findMeasure(eventId);
			System.out
					.println(measure
							+ "----------------------------measure----------------------------------");

			submiter = showEventDetailService.findSubmiter(eventId);
			System.out
					.println(submiter
							+ "----------------------------submiter----------------------------------");

			submitDept = showEventDetailService.findSubmitDept(eventId);
			System.out
					.println(submitDept
							+ "----------------------------submitDept----------------------------------");

			source = showEventDetailService.findSource(eventId);
			System.out
					.println(source
							+ "----------------------------source----------------------------------");

			death = showEventDetailService.findDeath(eventId);
			System.out
					.println(death
							+ "----------------------------death----------------------------------");

			injured = showEventDetailService.findInjured(eventId);
			System.out
					.println(injured
							+ "----------------------------injured----------------------------------");

			submitTime = showEventDetailService.findSubmitTime(eventId);
			System.out
					.println(submitTime
							+ "----------------------------submitTime----------------------------------");

			submiterContact = showEventDetailService.findSubmitTime(eventId);
			System.out
					.println(submiterContact
							+ "----------------------------submiterContact----------------------------------");

			accpetTime = showEventDetailService.findAcceptTime(eventId);
			System.out
					.println(accpetTime
							+ "----------------------------accpetTime----------------------------------");

			accepter = showEventDetailService.findAccepter(eventId);
			System.out
					.println(accepter
							+ "----------------------------accepter----------------------------------");

			eventStatus = showEventDetailService.findEventStatus(eventId);
			System.out
					.println(eventStatus
							+ "----------------------------eventStatus----------------------------------");

			eventDesc = showEventDetailService.findEventDesc(eventId);
			System.out
					.println(eventDesc
							+ "----------------------------eventDesc----------------------------------");
			
//			planStanderList = showEventDetailService.findPlanStanderd(eventId);
//			System.out
//			.println(planStanderList.size()
//					+ "----------------------------planStanderList----------------------------------");

		} catch (AgException e) {
			e.printStackTrace();
			throw e;
		}
		return "getDetail_succ";
	}

	public String getViceCommander() {
		return viceCommander;
	}

	public void setViceCommander(String viceCommander) {
		this.viceCommander = viceCommander;
	}

	public String getTeamLeader() {
		return teamLeader;
	}

	public void setTeamLeader(String teamLeader) {
		this.teamLeader = teamLeader;
	}

	public String getCommander() {
		return commander;
	}

	public void setCommander(String commander) {
		this.commander = commander;
	}

	public String getImplementPlan() {
		return implementPlan;
	}

	public void setImplementPlan(String implementPlan) {
		this.implementPlan = implementPlan;
	}

	public String getAssistDept() {
		return assistDept;
	}

	public void setAssistDept(String assistDept) {
		this.assistDept = assistDept;
	}

}
